{include file="header"}
<style>

</style>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card-header">
                <form action="{:url('search/index')}" method="get" class="layui-form layui-col-space5 hide">
                    <input type="hidden" name="search_cat" value="1">
                    <div class="layui-inline layui-show-xs-block">
                        作品名
                    </div>
                    <div class="layui-inline layui-show-xs-block">
                        <input type="text" class="layui-input" name="keyword" value="{if $search_cat eq 1}{$keyword}{/if}" placeholder="作品名搜索">
                    </div>
                    <div class="layui-inline layui-show-xs-block">
                        <button class="layui-btn" type="submit">搜索</button>
                    </div>
                </form>
            </div>

            <div class="layui-card-header">
                <form action="{:url('search/index')}" method="get" class="layui-form layui-col-space5 hide">
                    <input type="hidden" name="search_cat" value="2">
                    <div class="layui-inline layui-show-xs-block">
                        人&nbsp;&nbsp;&nbsp;&nbsp;名
                    </div>
                    <div class="layui-inline layui-show-xs-block">
                        <input type="text" class="layui-input" name="keyword" value="{if $search_cat eq 2}{$keyword}{/if}" placeholder="人名搜索">
                    </div>
                    <div class="layui-inline layui-show-xs-block">
                        <button class="layui-btn" type="submit">搜索</button>
                    </div>
                </form>
            </div>
            <div style="clear: both;"></div>
            <div class="layui-card-header tbt">
                {if $lists}
                {if $company}
                以下是隶属于<span class="x-red">{$company_title}</span>公司的人员,
                {else}
                以下搜索结果是<span class="x-red">{:request()->get('keyword')}</span>{if $author}创作{else}参与{/if}的作品，
                {/if}

                共<span class="x-red">{:count($lists)}</span>条记录
                {/if}
            </div>
            {if $search_cat eq 1}
            <div class="layui-card-body">
                <table class="layui-table layui-form">
                    <thead>
                    <tr>
                        <th>作品名</th>
                        <th>原作者</th>
                        <th>动画制作公司</th>
                        <th>漫画连载状态</th>
                        <th>TV更新状态</th>
                        <th>漫画首更年份</th>
                        <th>TV首更年份</th>
                    </tr>
                    </thead>
                    <tbody>
                    {volist name="lists" id="item"}
                    <tr>
                        <td>
                            <a href="javascript:;" onclick="add({$item.id})">
                                {$item.title} <br>
                                {$item.title_jp}
                            </a>

                        </td>
                        <td>
                            {$item.author} <br>
                            {$item.author_jp}
                        </td>
                        <td>
                            {volist name="$item.companys" id="val"}
                            {$val.title_cn}/{$val.title_jp} <br>
                            {/volist}
                        </td>
                        <td>
                            {if $item.comics_status eq 1}
                            连载中(目前{$item.comics_end_words}话)
                            {else}
                            已完结{if $item.comics_all}(全{$item.comics_all}话){/if}
                            {/if} </td>
                        <td>
                            {if $item.cartoon_status eq 1}
                            更新中(目前{$item.tv_end_words}话)
                            {else}
                            已完结{if $item.cartoon_all}(全{$item.cartoon_all}话){/if}
                            {/if}
                        </td>
                        <td> {$item.comics_start_time} </td>
                        <td> {$item.tv_start_time} </td>
                    </tr>
                    {/volist}
                    </tbody>
                </table>
            </div>
            {else}
            {if $datas['staff']}
            <div class="layui-card-body ">

                <table class="layui-table layui-form">
                    <thead>
                    <tr>   <th>制作者</th>
                        <th>生日</th>
                        <th>所属公司</th>
                        <th>参与的TV部数</th>
                        <th>参与的电影部数</th>
                        <th>参与的OVA部数</th>
                        <th>职务</th>
                        <th></th>

                    </tr>
                    </thead>
                    <tbody>
                    {volist name="$datas['staff']" id="item"}
                    <tr>
                        <td>
                            <div class="tips" id="tips_{$item.id}" data-id="{$item.id}" data-content="{$item.jp_ch} {$item.jp_jp} {$item.jp_lm}">{$item.uname}</div>
                        </td>
                        <td>{if $item.birthday}{$item.birthday}{else}/{/if}</td>
                        <td>
                            {if $item.company_id}
                            <a href="{:url('search/man')}?company={$item.company_id}" style="color: blue;">{$item.company}</a>
                            {else}
                            /
                            {/if}
                        </td>
                        <td>{$item.tvnum}</td>
                        <td>{$item.movienum}</td>
                        <td>{$item.ovanum}</td>
                        <td width="150">
                            <div class="tips" id="tips_{$item.id}_2" data-id="{$item.id}_2" data-content="{$item.jobs}" style="width: 150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">{$item.jobs}</div>
                        </td>
                        <td>
                            <a href="javascript:;" onclick="add_tab('{:url('search/work')}?work_id={:implode(',',$item['work_id'])}')" style="color: blue;">查看详情</a>
                        </td>
                    </tr>
                    {/volist}

                    </tbody>
                </table>

            </div>
            {/if}
            {if $datas['seiyuu']}
            <div class="layui-card-body ">

                <table class="layui-table layui-form">
                    <thead>
                    <tr>
                        <th>声优</th>
                        <th>生日</th>
                        <th>所属公司</th>
                        <th>参与的TV部数</th>
                        <th>参与的电影部数</th>
                        <th>参与的OVA部数</th>
                        <th></th>
                        <th></th>

                    </tr>
                    </thead>
                    <tbody>
                    {volist name="$datas['seiyuu']" id="item"}
                    <tr>
                        <td>
                            <div class="tips" id="tips_{$item.id}" data-id="{$item.id}" data-content="{$item.jp_ch} {$item.jp_jp} {$item.jp_lm}">{$item.uname}</div>
                        </td>
                        <td>{if $item.birthday}{$item.birthday}{else}/{/if}</td>
                        <td>
                            {if $item.company_id}
                            <a href="{:url('search/man')}?company={$item.company_id}" style="color: blue;">{$item.company}</a>
                            {else}
                            /
                            {/if}
                        </td>
                        <td>{$item.tvnum}</td>
                        <td>{$item.movienum}</td>
                        <td>{$item.ovanum}</td>
                        <td width="150">

                        </td>
                        <td>
                            <a href="javascript:;" onclick="add_tab('{:url('search/work')}?work_id={:implode(',',$item['work_id'])}')" style="color: blue;">查看详情</a>
                        </td>
                    </tr>
                    {/volist}

                    </tbody>
                </table>

            </div>
            {/if}
            {/if}

        </div>
    </div>
</div>
<script>
    function add_tab(url) {
        window.parent.$('.search_man').removeClass("active")
        window.parent.$('.search_work').addClass("active")
        window.parent.add_tab2(url)
    }
    function add(id) {
        xadmin.open('作品详情','{:url("cartoon/details")}?search=1&id='+id,null,null,true,function () {
            window.location.reload();
        })
    }
</script>
{include file="footer"}